In the write operation of a nonvolatile semiconductor memory, write and verify for detecting after the write whether the number of fail bits is smaller than a predetermined value are repetitively performed. However, when the number of fail bits increases due to a smaller memory cell size, the number of repetitions also increases, resulting in difficulty in increasing the speed of write operation.
In addition, when the number of bits to be written in one memory cell increases along with an increase in the number of signal levels to be written in a memory cell, the threshold distribution of each bit needs to fall within a narrow range. To do this, control needs to be done to gradually shift the memory cell threshold. This also leads to an increase in the number of repetitions of write and verify.
Quickly detecting the number of fail bits when the number of repetitions of write and verify increases is an important factor for increasing the speed of write operation.